﻿using EFCodeFirs.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCodeFirs
{
    class Program
    {
        static void Main(string[] args)
        {
            //使用这个CodeFirst创建数据库
            using (var ctx = new SchoolContext())
            {
                
                ctx.Schools.Add(new SchoolModel { SchoolId = 1,SchoolName = "中国石油大学", SchoolAddress = "北京中关村" });
                //ctx.Schools.Add(new SchoolModel { SchoolName = "中国石油大学", SchoolAddress = "北京中关村" });
                ctx.SaveChanges(); 
            }
            Console.ReadKey();
        }
    }
}
